package pl.makimo.ksr.gui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import pl.makimo.fuzzy.sets.memberships.MembershipFunction;

abstract public class MembershipFunctionCreator extends JFrame {
	private JPanel contentPane;
	protected JPanel parametersPane;
	private JButton okButton;
	


	abstract public MembershipFunction getFunction();
	
	public void setAction(ActionListener onSuccess) {
		okButton.addActionListener(onSuccess);
	}
	
	/**
	 * Create the frame.
	 */
	public MembershipFunctionCreator() {
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
		setContentPane(contentPane);
		
		parametersPane = new JPanel();
		parametersPane.setLayout(new BoxLayout(parametersPane, BoxLayout.Y_AXIS));
		
		contentPane.add(parametersPane);
		
		okButton = new JButton("OK");
		contentPane.add(okButton);
		
		okButton.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				setVisible(false);
			}
		});		
	}
}
